export const fetchArticle = async (url) => {
    try {
        const response = await fetch(`${process.env.REACT_APP_API_URL}/fetch_article`, {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
            },
            body: JSON.stringify({ url: url }),
        });
        if (!response.ok) throw new Error("Failed to fetch article");

       return response;
    } catch (error) {
        console.error("Error fetching article:", error);
        return null;
    }
};